using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using UnityEngine;
using HedgehogTeam.EasyTouch;
public class GesturesIput : MonoBehaviour
{
    
    [Header("操作对象")]
    public Transform actionObject;
    private void Update()
    {
        Gestures();
    }

    public void Gestures()
    {
        Gesture currentGesture = EasyTouch.current;
      
        if (currentGesture==null)
        {
            return;
        }
//        Debug.Log(currentGesture.type);
        //手指向左滑动
        if ( EasyTouch.EvtType.On_Swipe == currentGesture.type && currentGesture.swipe == EasyTouch.SwipeDirection.Left)
        {
            actionObject.eulerAngles += new Vector3(0, 15f, 0);
           
        }
        //手指向右滑动
        else if ( EasyTouch.EvtType.On_Swipe == currentGesture.type && currentGesture.swipe == EasyTouch.SwipeDirection.Right)
        {
            actionObject.eulerAngles -= new Vector3(0, 15f, 0);
        }
        //手势向上滑动
        else if ( EasyTouch.EvtType.On_Swipe == currentGesture.type && currentGesture.swipe == EasyTouch.SwipeDirection.Up)
        {
           
            actionObject.eulerAngles += new Vector3(15f, 0, 0);
        }
        //手势向下滑动
        else if (EasyTouch.EvtType.On_Swipe == currentGesture.type && currentGesture.swipe == EasyTouch.SwipeDirection.Down)
        {
            
            actionObject.eulerAngles -= new Vector3(15f, 0, 0);
        }
       
        
    }
}
